#!/bin/sh

mount sysfs
/sbin/mdev -s

# NIC up
ip link set lo up
ip link set eth0 up
ip addr add 10.0.2.15/24 dev eth0
ip route add default via 10.0.2.2

# mount all
mkdir dev/pts
mount -a

# telnet
telnetd -l ${LOGIN} &

# mount nfs
mount /mnt

# use unprivileged ICMP ping sockets to allow ping to the Internet
# https://www.qemu.org/docs/master/system/devices/net.html#using-the-user-mode-network-stack
echo 0 0 > /proc/sys/net/ipv4/ping_group_range
